<?php
/*
	打印机参数设置
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'setting';
$merchid=$this->checklogin();
if($_RQ['op']=='setting'){
	if($_RQ['postdata']){
		$post=get_postdata();
		$data=array_fields(array('user','ukey'),$post);
		$this->plugin_setting('setting'.$merchid,$data);
		exi('设置成功！');
	}
	$item=$this->plugin_setting('setting'.$merchid);
	if(!$item){
		$item=array('user'=>'');
	}
	$return['item']=$item;
	$return['htmls']=array(
		'type'=>'edit',
		'desc'=>'设置飞蛾打印机接口参数',
		'edit'=>array(
			array('type'=>'string','name'=>'user','title'=>'管理员账号USER','help'=>'飞鹅云后台注册用户名，前往飞蛾物联官网注册获取 http://admin.feieyun.com/ '),
			array('type'=>'string','name'=>'ukey','title'=>'管理员密钥UKEY','help'=>'飞鹅云后台注册用户密钥，前往飞蛾物联官网注册获取 http://admin.feieyun.com/ '),
		),
	);
	exi($return);
}